<?php
	class kehoachhoctapdata
	{
		public function Them($khht_ma = "", $khht_masv = "")
		{
			$sql = "INSERT INTO khoa(khht_ma, khht_ma)
					VALUES('$khht_ma', '$khht_ma')";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function CapNhat($khht_ma = "", $khht_masv = "")
		{
			$sql = "UPDATE kehoachhoctap SET khht_masv = '$khht_masv' WHERE khht_ma = '$khht_ma'";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function Xoa($khht_ma = "")
		{
			$sql = "DELETE  FROM khoa WHERE khht_ma = '$khht_ma'";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function LayDanhSach($khht_ma = "")
		{
			$sql = "SELECT * FROM khoa WHERE 1";
			
			if($khht_ma != "")
				$sql .= " AND khht_ma = '$khht_ma'";
			
			$service = new dataservice();
			return $service->ExecuteQuery($sql);
		}
	}
?>